Merge "Add meta=userinfo&uiprop=latestcontrib"
[lhc/web/wiklou.git] / tests / selenium / specs / rollback.js
index c52eca1..805b793 100644 (file)
@@ -43,13 +43,14 @@ describe( 'Rollback with confirmation', function () {
 
                HistoryPage.rollback.click();
 
-               assert.strictEqual( HistoryPage.rollbackConfirmable.getText(), 'Rollback of one edit?' );
+               assert.strictEqual( HistoryPage.rollbackConfirmable.getText(), 'Please confirm:' );
                assert.strictEqual( HistoryPage.rollbackConfirmableYes.getText(), 'Rollback' );
                assert.strictEqual( HistoryPage.rollbackConfirmableNo.getText(), 'Cancel' );
        } );
 
        it( 'should offer a way to cancel rollbacks', function () {
                HistoryPage.rollback.click();
+               browser.pause( 300 );
                HistoryPage.rollbackConfirmableNo.click();
 
                browser.pause( 500 );
@@ -66,6 +67,22 @@ describe( 'Rollback with confirmation', function () {
                        return browser.getText( '#firstHeading' ) === 'Action complete';
                }, 5000, 'Expected rollback page to appear.' );
        } );
+
+       it( 'should verify rollbacks via GET requests are confirmed on a follow-up page', function () {
+               var rollbackActionUrl = HistoryPage.rollbackLink.getAttribute( 'href' );
+               browser.url( rollbackActionUrl );
+
+               browser.waitUntil( function () {
+                       return HistoryPage.rollbackNonJsConfirmable.getText() === 'Revert edits to this page?';
+               }, 5000, 'Expected rollback confirmation page to appear for GET-based rollbacks.' );
+
+               HistoryPage.rollbackNonJsConfirmableYes.click();
+
+               browser.waitUntil( function () {
+                       return browser.getText( '#firstHeading' ) === 'Action complete';
+               }, 5000, 'Expected rollback page to appear.' );
+       } );
+
 } );
 
 describe( 'Rollback without confirmation', function () {
@@ -103,7 +120,7 @@ describe( 'Rollback without confirmation', function () {
                HistoryPage.open( name );
        } );
 
-       it( 'should perform rollback without asking the user to confirm', function () {
+       it( 'should perform rollback via POST request without asking the user to confirm', function () {
                HistoryPage.rollback.click();
 
                // waitUntil indirectly asserts that the content we are looking for is present
@@ -111,4 +128,13 @@ describe( 'Rollback without confirmation', function () {
                        return HistoryPage.headingText === 'Action complete';
                }, 5000, 'Expected rollback page to appear.' );
        } );
+
+       it( 'should perform rollback via GET request without asking the user to confirm', function () {
+               var rollbackActionUrl = HistoryPage.rollbackLink.getAttribute( 'href' );
+               browser.url( rollbackActionUrl );
+
+               browser.waitUntil( function () {
+                       return browser.getText( '#firstHeading' ) === 'Action complete';
+               }, 5000, 'Expected rollback page to appear.' );
+       } );
 } );